package com.ybg.demo.consul.producer.controller;

import com.ybg.iot.common.vo.ResultVoFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping(value = "/user")
public class UserController {

    @PostMapping(value = "/login")
    public Map<String, Object> login(String loginName, String password) {
        if ("ybg".equals(loginName) && "123".equals(password)) {
            return ResultVoFactory.createSuccessVo();
        }
        return ResultVoFactory.createFailVo("001", "用户名或密码错误");
    }

}
